<Window x:Uid="Window_1" x:Class="Adastra.RichEditorLibrary.ImagePropertiesDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:Microsoft.WPFControlsLibrary;assembly=WPFControlsLibrary"   
        xmlns:properties="clr-namespace:Adastra.RichEditorLibrary.Properties"
    Title="Obrázek" Height="450" Width="450">
    <!-- -->
    <Window.Resources>
        <ResourceDictionary x:Uid="ResourceDictionary_1">
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary x:Uid="ResourceDictionary_2" Source="..\Resources\Styles\MainViewStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <!-- NumricEditorStyle -->
            <Style x:Uid="Style_1" x:Key="NumricEditorStyle" TargetType="{x:Type controls:ValueEditor}">
                <Setter x:Uid="Setter_1" Property="Template">
                    <Setter.Value>
                        <ControlTemplate x:Uid="ControlTemplate_1" TargetType="{x:Type controls:ValueEditor}">
                            <Grid x:Uid="Grid_1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Uid="ColumnDefinition_1" Width="0.5*"/>
                                    <ColumnDefinition x:Uid="ColumnDefinition_2" />
                                </Grid.ColumnDefinitions>
                                <controls:NumberTextBox x:Uid="PART_EDITOR" x:Name="PART_EDITOR" Style="{DynamicResource NumricTextBoxStyle}" Text="{Binding Path=Value, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Grid.ColumnSpan="2"/>
                                <Rectangle x:Uid="PART_DRAGGER" x:Name="PART_DRAGGER"  Stroke="Transparent" Fill="Transparent" />
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger x:Uid="Trigger_1" Property="IsMouseOver" Value="True" SourceName="PART_DRAGGER">
                                    <Setter x:Uid="Setter_2" Property="Cursor" Value="SizeAll"/>
                                </Trigger>
                                <Trigger x:Uid="Trigger_2" Property="IsDragging" Value="True">
                                    <Setter x:Uid="Setter_3" Property="Cursor" Value="SizeAll"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </Window.Resources>
    <Grid x:Uid="Grid_2">
        <Grid.RowDefinitions>
            <RowDefinition x:Uid="RowDefinition_1" Height="276*" />
            <RowDefinition x:Uid="RowDefinition_2" Height="35" />
        </Grid.RowDefinitions>
        <TabControl x:Uid="m_tabbedWorkspace" Grid.Row="0" x:Name="m_tabbedWorkspace" Margin="1,1,1,1" >
            <TabItem x:Uid="m_tabProperties" x:Name="m_tabProperties" Header="Základní vlastnosti" >
                <Grid x:Uid="Grid_3">
                    <Grid.RowDefinitions>
                        <RowDefinition x:Uid="RowDefinition_3" Height="160" />
                        <RowDefinition x:Uid="RowDefinition_4"/>
                    </Grid.RowDefinitions>
                    <GroupBox x:Uid="GroupBox_1" Header="Vlastnosti originálního obrázku" Grid.Row="0" BorderThickness="0.1">
                        <Grid x:Uid="Grid_4">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Uid="ColumnDefinition_3" Width="60" />
                                <ColumnDefinition x:Uid="ColumnDefinition_4" />
                            </Grid.ColumnDefinitions>

                            <Grid.RowDefinitions>
                                <RowDefinition x:Uid="RowDefinition_5" Height="40"/>
                                <RowDefinition x:Uid="RowDefinition_6" Height="30"/>
                                <RowDefinition x:Uid="RowDefinition_7" Height="30"/>
                                <RowDefinition x:Uid="RowDefinition_8" Height="40"/>
                            </Grid.RowDefinitions>

                            <Label x:Uid="Label_1" Grid.Row="0" Grid.Column="0" Content="{x:Static properties:Resources.ImagePropertiesDialog_Label_1_Content}"  Foreground="Black"  Margin="10,0,0,0" ToolTip="Zdrojová cesta k umístění obrázku"/>
                            <Grid x:Uid="Grid_5" Grid.Row="0" Grid.Column="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Uid="ColumnDefinition_5"/>
                                    <ColumnDefinition x:Uid="ColumnDefinition_6" Width="70"  />
                                </Grid.ColumnDefinitions>
                               
                                <TextBox  x:Uid="m_txbxPath" Grid.Row="0" Grid.Column="0" Name="m_txbxPath" GotFocus="OnPathGotFocus" LostFocus="OnNavigateUriLostFocus" Width="auto" 
                                     ToolTip="Zadejte zdrojovou cestu k umístění obrázku" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                                     Text="{Binding Path=ImagePath, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Margin="10,0,0,0" Height="21"/>
                                
                                <Button  x:Uid="Button_1" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="OnBrowseClick"  Style="{DynamicResource BlackButtonStyle}" 
                                Content="{x:Static properties:Resources.ImagePropertiesDialog_Button_1_Content}" Margin="5,5,5,5" ToolTip="Nastaví původní hodnoty originálního obrázku (velikost...)" Width="60" />
                            </Grid>
                            <Label x:Uid="m_lblPictureInfoName" Grid.Row="1" Grid.Column="1" Margin="10,0,0,0"  Name="m_lblPictureInfoName"  Foreground="Black" BorderThickness="0.1" BorderBrush="Black"/>
                            <Label x:Uid="m_lblPictureInfoSize" Grid.Row="2" Grid.Column="1" Margin="10,0,0,0"  Name="m_lblPictureInfoSize"  Foreground="Black" BorderThickness="0.1" BorderBrush="Black"/>
                            <Button x:Uid="Button_2" Grid.Row="3" Grid.Column="1" IsEnabled="False" Visibility="Hidden" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="OnSetDefaultsClick" Style="{DynamicResource BlackButtonStyle}" 
                                Content="{x:Static properties:Resources.ImagePropertiesDialog_Button_2_Content}" Margin="5,5,5,5" ToolTip="Nastaví původní hodnoty originálního obrázku (velikost...)" />
                        </Grid>
                    </GroupBox>
                    <GroupBox x:Uid="GroupBox_2" Header="Aktuální vlastnosti" Grid.Row="1" BorderThickness="0.1">
                        <Grid x:Uid="Grid_6">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Uid="ColumnDefinition_7" Width="60" />
                                <ColumnDefinition x:Uid="ColumnDefinition_8" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition x:Uid="RowDefinition_9" Height="0"/>
                                <RowDefinition x:Uid="RowDefinition_10" Height="0"/>
                                <RowDefinition x:Uid="RowDefinition_11" Height="30"/>
                                <RowDefinition x:Uid="RowDefinition_12"/>
                            </Grid.RowDefinitions>
                            <Label x:Uid="Label_2" Grid.Column="0" Grid.Row="0" Content="{x:Static properties:Resources.ImagePropertiesDialog_Label_2_Content}" Margin="10,0,0,0" Foreground="Black" Visibility="Hidden" />
                            <controls:ValueEditor x:Uid="m_txBxWidth" Grid.Column="1" Grid.Row="0"  Name="m_txBxWidth" Height="21" Visibility="Hidden" Width="70" Margin="10,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"
                                                            Style="{DynamicResource NumricEditorStyle}"
                                                            Value="{Binding Path=ImageWidth, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                                                            LargeChange="0.5"
                                                            MaxPrecision="2"
                                                            Minimum="0"
                                                            SmallChange="0.1"
                                                            DefaultChange="0.1"/>
                            <!--TextBox Name="m_txBxWidth" Text="{Binding Path=Width, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"  Height="21" Width="70" Margin="10,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/-->

                            <Label x:Uid="Label_3" Grid.Column="0" Grid.Row="1" Content="{x:Static properties:Resources.ImagePropertiesDialog_Label_3_Content}" Visibility="Hidden" Margin="10,0,0,0" Foreground="Black"/>
                            <controls:ValueEditor x:Uid="m_txBxHeight" Grid.Column="1" Grid.Row="1"  Visibility="Hidden" Name="m_txBxHeight" Height="21" Width="70" Margin="10,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"
                                                            Style="{DynamicResource NumricEditorStyle}"
                                                            Value="{Binding Path=ImageHeight, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                                                            LargeChange="0.5"
                                                            MaxPrecision="2"
                                                            Minimum="0"
                                                            SmallChange="0.1"
                                                            DefaultChange="0.1"/>
                            <!--TextBox Grid.Column="1" Grid.Row="1" Name="m_txBxHeight" Text="{Binding Path=Height, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Height="21" Width="70" Margin="10,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/-->

                            <Label x:Uid="Label_4" Grid.Column="0" Grid.Row="2" Content="{x:Static properties:Resources.ImagePropertiesDialog_Label_4_Content}" ToolTip="Odkaz na webovou adresu" Margin="10,0,0,0" Foreground="Black"/>
                            <TextBox x:Uid="m_txBxHyperlink" Grid.Column="1" Grid.Row="2" Name="m_txBxHyperlink"  ToolTip="Zadejte odkaz na webovou adresu, kam se po kliknutí na obrázek uživatel proklikne"
                                     Text="{Binding Path=ImageHyperlink, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Height="21" Width="auto" Margin="10,5,0,0" 
                                     HorizontalAlignment="Stretch" VerticalAlignment="Top"  GotFocus="OnPathGotFocus"/>
                            <ScrollViewer x:Uid="ScrollViewer_1" Grid.Column="1" Grid.Row="3" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" >
                                <Image x:Uid="m_webBrowser" Name="m_webBrowser" IsEnabled="False" HorizontalAlignment="Left" VerticalAlignment="Top" />
                            </ScrollViewer>
                        </Grid>
                    </GroupBox>
                </Grid>

            </TabItem>
        </TabControl>
        <Button x:Uid="Button_3" Grid.Row="1" IsCancel="True" Margin="0,5,108,5" HorizontalAlignment="Right" Width="75" Click="OnCancelClick" >Storno</Button>
        <Button x:Uid="Button_4" Grid.Row="1" IsDefault="True" HorizontalAlignment="Right" Margin="0,5,6,5" Width="75" Click="OnOkClick">OK</Button>

    </Grid>
</Window>
